package com.polaris.live.popup

import android.content.Context
import com.lxj.xpopup.core.CenterPopupView
import com.polaris.live.common.ext.setOnSingleClickListener
import com.polaris.live.databinding.PopupCloseFreecallBinding

/**
 * 关闭免费通话弹窗
 *
 * @author Created by 天晴 on 2023/12/26/004 14:21
 */
class CloseFreeCallPopup(
    context: Context,
    var back: (() -> Unit),
    var answer: (() -> Unit)
) : CenterPopupView(context) {

    private lateinit var mBinding: PopupCloseFreecallBinding
    private var about = ""

    override fun getImplLayoutId(): Int {
        return com.polaris.live.R.layout.popup_close_freecall
    }

    override fun onCreate() {
        super.onCreate()

        mBinding = PopupCloseFreecallBinding.bind(popupImplView)

        mBinding.tvClosePhone.setOnSingleClickListener {
            back.invoke()
            dismiss()
        }

        mBinding.tvAnswerPhone.setOnSingleClickListener {
            answer.invoke()
            dismiss()
        }
    }
}